import Request from '@/utils/request/index'

export const getById = (params) => {
  return Request.request({
    url: `/h5/event/getByIdInfo?id=${params}`,
    method: 'GET',
  })
}

export const getByMore = (params) => {
  return Request.request({
    url: '/h5/event/getByMore',
    method: 'GET',
    params,
  })
}

export const list = () => {
  return Request.request({
    url: `/h5/event/list`,
    method: 'GET',
  })
}

export const productCategory = () => {
  return Request.request({
    url: `/h5/ProductCategory/list`,
    method: 'GET',
  })
}

export const productList = (data) => {
  return Request.request({
    url: `/h5/ProductCategory/product/list`,
    method: 'POST',
    data,
  })
}

export const create = (data) => {
  return Request.request({
    url: `/h5/event/createEvtOrder`,
    method: 'POST',
    data,
  })
}

export const getList = (params) => {
  return Request.request({
    url: `/h5/event/listUserEventOrders`,
    method: 'GET',
    params,
  })
}

export const cancel = (params) => {
  return Request.request({
    url: `/h5/event/cancelUserEventOrders`,
    method: 'GET',
    params,
  })
}

export const queryGrades = (params) => {
  return Request.request({
    url: `/h5/event/queryGrades`,
    method: 'GET',
    params,
  })
}

export const queryScore = (data) => {
  return Request.request({
    url: `/h5/event/listUserScoreOrders`,
    method: 'POST',
    data,
  })
}
